color picker: Also try kwin
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 Aug 2018 00:55:07 +0000 (20:55 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 5 Aug 2018 01:48:29 +0000 (01:48 +0000)
use a kwin color picker when we run under kwin.

gtk/gtkcolorpicker.c

index d57ffe016e9940d4782d9fee68602c0177f3a69b..6b3f5f79c198da4578d68b00d6ec5ba74baf282e 100644 (file)
@@ -20,7 +20,7 @@
 #include "gtkcolorpickerprivate.h"
 #include "gtkcolorpickerportalprivate.h"
 #include "gtkcolorpickershellprivate.h"
-#include "gtkprivate.h"
+#include "gtkcolorpickerkwinprivate.h"
 #include <gio/gio.h>
 
 
@@ -53,15 +53,16 @@ gtk_color_picker_new (void)
 {
   GtkColorPicker *picker;
 
-  if (gtk_should_use_portal ())
-    picker = gtk_color_picker_portal_new ();
-  else
+  picker = gtk_color_picker_portal_new ();
+  if (!picker)
     picker = gtk_color_picker_shell_new ();
+  if (!picker)
+    picker = gtk_color_picker_kwin_new ();
 
-  if (picker)
-    g_debug ("Using %s for picking colors", g_type_name_from_instance (picker));
+  if (!picker)
+    g_debug ("No suitable GtkColorPicker implementation");
   else
-    g_debug ("No suitable GtkColorPicker implementation\n");
+    g_debug ("Using %s for picking colors", G_OBJECT_TYPE_NAME (picker));
 
   return picker;
 }